/**
* Copyright (c) 2015 UNI-TREND Co., Ltd.
* All rights reserved.  
*  
* @file        ScpiParse.cpp
* @brief       
* @version     1.0 
* @author      
* @Email       
* @date        2015-11-20
*/
#include "ScpiActions.h"
/** IMPORTENT FUNC */
void CScpiParser::InitParser()
{
    //change:----str-------------class-------
    m_parseMap["*IDN"] = new CScpiActIDN();
    m_parseMap["*OPC"] = new CScpiActOPC();
    m_parseMap["TDIV"] = new CScpiActTDIV();
    m_parseMap["VDIV"] = new CScpiActVDIV();
}
void CScpiParser::Parse(CMD_TYPE cmd)
{
    map<CMD_TYPE, CMD_ACTION>::iterator it;

    it = m_parseMap.find(SplitMain(cmd));
    if (it != m_parseMap.end())
    {
        if(IsAsk(cmd))
            it->second->Get(cmd);
        else
            it->second->Set(cmd);
    }
}

